let Router=require('koa-router')

let router=new Router({prefix:"/goods"})

let {auth,adminPermission}=require('../middleware/auth.js')
let {goodCheck}=require('../middleware/goods.js')
let {upload,createGood,updateGood,remove,restore,findAll}=require('../control/goods.js')

router.post('/upload',auth,adminPermission,upload)

router.post('/fb',auth,adminPermission,goodCheck,createGood)

router.post('/update/:id',auth,adminPermission,goodCheck,updateGood)

router.post('/:id/off',auth,adminPermission,remove)

router.post('/:id/on',auth,adminPermission,restore)

router.post('/',findAll)
module.exports=router